from datetime import datetime
from django.db import models
from shops.models import ShopsModel
from user.models import UserModel

# Create your models here.
class Speaking(models.Model):
    chatid = models.CharField(max_length=20,verbose_name="聊天室ID")
    uid = models.ForeignKey(UserModel, on_delete=models.CASCADE, verbose_name="顾客ID")
    bid = models.ForeignKey(ShopsModel, on_delete=models.CASCADE, verbose_name="商家ID")
    speatxt = models.TextField(max_length=10000, verbose_name="聊天内容")
    reply = models.IntegerField(verbose_name="0顾客1商家",default=0)

    def __str__(self):
        return self.speatxt

    class Meta:
        db_table = 'tb_speak'
        verbose_name = "聊天表"
